package com.poizon.api;

import com.poizon.manager.intf.SmsService;
import com.poizon.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName SmsController
 * @Author NoCheng
 * @Date 2022/1/2 16:04
 * @Description:TODO 短信验证码相关
 */

@RestController
@CrossOrigin
@RequestMapping("/api/sms/")
@Api(value = "实现短信的相关操作",tags = "实现短信的相关操作")
public class SmsController {
    private final SmsService service;

    public SmsController(SmsService service) {
        this.service = service;
    }


    @PostMapping("loginCode.do")
    @ApiOperation(value = "发送登录验证码")
    public R sendLoginCode(String phone){
        return service.sendLoginCode(phone);
    }

    @PostMapping("findCode.do")
    @ApiOperation(value = "发送密码找回验证码")
    public R sendFindCode(String phone){
        return service.sendFindCode(phone);
    }



}
